<extend name="Base/common"/>
<block name="style">
 <script language="javascript" src="__PUBLIC__/Wap/js/swipe.js"></script>
</block>

<block name="content">
    <div id="loadingPicBlock">
        <div class="wrapper">
            <style type="text/css">
                .box_swipe {overflow: hidden; position: relative;}
                .box_swipe ul {overflow: hidden; position: relative;margin:0;padding:0;}
                .box_swipe ul > li {float:left; width:100%; position: relative; text-align:center;}
                .box_swipe ul > li a{color:#FFF; text-decoration:none; width: 10px;height: 10px;}
                .box_swipe ul > li .title{position: absolute; bottom: 6px; display: block; padding:0 10px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; color:#FFF; z-index:100;}
                .box_swipe>ol{height:20px; position: relative; z-index:10; margin-top:-24px; text-align:right; padding-right:15px;}
                .box_swipe>ol>li{display:inline-block; margin-bottom:1px; width:8px; height:8px; background-color:#757575; border-radius: 8px;}
                .box_swipe>ol>li.on{background-color:#ffffff;}

            </style>
            <div id="banner_box" class="box_swipe" style='width:100%;'>
                <ul>
                    <volist name="advs" id="adv">
                        <li>
                            <a href='<if condition="$adv['ad_link'] eq '' ">#<else />{$adv['ad_link']}</if>'>
                                <img src="{$adv['thumb']}" title="{$adv['ad_name']}" style='width:100%;height: 8rem;'/>
                            </a>
                        </li>
                    </volist>
                </ul>
                <ol>
                  <volist name="advs" id="adv" key="k">
                      <li <if condition="$k eq 1">class="on"</if>></li>
                  </volist>
                </ol>
            </div>
            <script>
                $(function() {
                    new Swipe($('#banner_box')[0], {
                        speed:500,
                        auto:3000,
                        callback: function(){
                            var lis = $(this.element).next("ol").children();
                            lis.removeClass("on").eq(this.index).addClass("on");
                        }
                    });
                });
            </script>
            <div class="column" style="position: absolute;">
                <a href="javascript:;" title="进行中的拍卖" class="entry-list">进行中的竞价<span></span><b class="fr"></b></a>
                <div class="sort_list" id="sort_listnow" style="display: none;">
                    <ul>
                         <li order="10"><a href="{:U('index')}">所有进行中的竞价<i></i></a></li>
                        <volist name="list" id="row">
                          <li order="10"><a href="{:U('index',array('bind'=>$row['id']))}">{$row['name']}<i></i></a></li>
                        </volist>
                    </ul>
                </div>
                <a href="javascript:;" title="已完成的拍卖" class="ann-publicly">已完成的竞价<span></span><b class="fl"></b><cite id="biaoji"><em></em></cite></a>
                <div class="sort_list" id="sort_listfin" style="display: none;">
                    <ul>
                        <li order="10"><a href="{:U('area')}">所有已完成的竞价<i></i></a></li>
                        <volist name="list_end" id="row">
                            <li order="10"><a href="{:U('area',array('bind'=>$row['id']))}">{$row['name']}<i></i></a></li>
                        </volist>
                    </ul>
                </div>
            </div>
            <div class="goodList" style="position: relative;top: 38px;">
           
            <ul id="21960">
              <volist name="good_list" id="row">
                     <?php
                              $good_id=$row['id'];
                              $goods=M('goods')->where(array('id'=>$row['good_id']))->find();
                              $goods['good_img_arr']=explode(',',$goods['good_img']);


                              $where['bid_id']=$row['bid_id'];
                              $where['good_id']=$row['id'];
                              $user_list=M('bid_user')->where($where)->order('per_price desc,create_time asc')->select();
                              $row['user_count']=count($user_list);

                              $bid=M('bid_list')->where(array('id'=>$row['bid_id']))->find();

                      ?> 
                <li>
                  <span class="gList_l fl" style="">
                          <a href=""><img src="__ROOT__{$goods['good_img_arr'][0]}" ></a>
                   </span>
                 <div class="gList_r">
                    <a href="{:U('details',array('id' => $row['id']))}">
                        <h3 class="gray6">{$goods['goods_name']}</h3>
                        <em class="gray9">成交价：<if condition="$row['user_count'] eq 0">无<else/>￥{$user_list[0]['per_price']}</if></em>
                    </a>
                    <a href="{:U('details',array('id' => $row['id']))}">
                     <div class="gRate">
                        <div class="Progress-bar" style="margin-right: 0;">
                            <p class="u-progress">
                                <span style="width: 100%;" class="pgbar"><span class="pging"></span></span>
                            </p>
                      <ul class="Pro-bar-li">
                       <li class="P-bar01"><em><if condition="$row['user_count'] eq 0">商品流拍<else/>获得者<?php echo getUSerBidSn(I('get.bind'),$user_list[0]['user_id']);?></if></em></li>
                       <li class="P-bar03"><em>{$row['user_count']}</em>出价次数</li>
                    
                      </ul>
                   </div>
                  </div>
                 </a>
               </div> 
              </li>
            </volist>
          </ul>
             

            <empty name="good_list">
                    <div class="noRecords gray9"><s></s>暂无记录</div>
           </empty>

            <div id="divGoodsLoading" class="loading" ><!-- <b></b>正在加载 --></div>
            </div>
            <div class="load_more" id="btnLoadMore" style="display: none;"><aside class="more"><a href="javascript:void(0);" onclick="getMoreRecru(2)">查看更多</a></div>
        </div>
        <div style="height: 60px;"></div>
    </div>

</block>

<block name="script">
    <script type="text/javascript">
        function getMoreRecru(page){
            var ajxurl="{:U('Ajaxgetzwlist')}";
            $.ajax({
                type:"GET",
                 data:{
                   pages:page,
                },
                url:ajxurl,
                dataType:'json',
                beforeSend:function(XMLHttpRequest){
                    $('.more').html('<img src="../images/loading.gif" />');
                },
                success:function(data){
                    if (data.success){
                        if (data.list.length > 0){
                            for (var i in data.list){
                                var info = data.list[i];
                                $('#container').append('<a  class="block arr"  href=""><img  src="images/'+info.zptype+'.png"><dl  class="fix"><dt><span class="ongoing">'+info.residedist+'</span>'+info.title+'</dt><dd><span class="location">'+info.pubdate+'</span><span class="date">浏览量：'+info.hitnumber+'</span></dd></dl></a>'
                            );
                            };
                            page+= 1;
                            $('.more').html('<a href="javascript:void(0);" onclick="getMoreRecru('+page+');">查看更多</a>');
                        }
                        else{
                            $('.more').html('没有更多内容了...');
                        }
                    }
                    else{
                        alert('加载失败, 当前网络不给力?');
                        $('.more').html('<a href="javascript:void(0);" onclick="getMoreRecru('+page+');">再次尝试加载</a>');
                    }
                }
            });
        }
        $('.entry-list').click(function(){
            $('.goodList').hide();
            $('#sort_listfin').hide();
            $('#biaoji').remove();
            $('.entry-list .fr').after("<cite id='biaoji'><em></em></cite>");
            $('#sort_listnow').show();
        });
        $('.ann-publicly').click(function(){
            $('.goodList').hide();
            $('#sort_listnow').hide();
            $('#biaoji').remove();
            $('.ann-publicly .fl').after("<cite id='biaoji'><em></em></cite>");
            $('#sort_listfin').show();
        });
    </script>
</block>